<template>
  <router-view></router-view>
</template>

<script lang="ts" setup>
import { onMounted, onDeactivated } from 'vue'
import { ConfigProvider, message } from 'ant-design-vue'

/**
 * 获取设置的主题色
 */
const primaryColor = localStorage.getItem('primaryColor') ?? '#1890ff'
ConfigProvider.config({
  theme: {
    primaryColor: primaryColor,
  },
})
// const beforeunloadFn = (e: any) => {
//   message.error('确定关闭')
//   return false
// }

// onMounted(() => {
//   window.addEventListener('beforeunload', (e) => beforeunloadFn(e))
// })

// onDeactivated(() => {
//   localStorage.removeItem('userName')
//   window.removeEventListener('beforeunload', (e) => beforeunloadFn(e))
// })
</script>

<style scoped></style>
